package com.jt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jt.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
//继承时,必须添加泛型.该泛型必须与表关联
//MP提供了强大的单表CRUD操作. 多表操作自己写
public interface UserMapper extends BaseMapper<User> {

    List<User> findAll();


    User findUserByUP(User user);

@Select("select count(1) from user ")
    long findCount();

    List<User> findUserLimit(@Param("query") String query,
                             @Param("start") int start,
                             @Param("size")int size);

    void updateStatus(User user);

    void addUser(User user);
@Delete("delete  from user where id=#{id}")
    void deleteUser(User user);
@Select("Select * from user where id =#{id}" )
    User findUserById(Integer id);

    void updateUser(User user);

}
